<template>
    <div>
        <el-alert title="P为接／发运的重车皮数量，TEU为接／发运的标准箱量，40尺的箱子为2TEU" type="warning" close-text="知道了">
        </el-alert>
        <template v-if="power('WJOB_TRAIN_STATISTICALQUERY')">
            <el-row>
                <div class="clear1"></div>
                <el-col :span="12">
                    <h3>接运量</h3>
                    <div class="clear1"></div>
                    <el-radio v-model="search_EQ_dateType" :label="'month'">按月</el-radio>
                    <el-radio v-model="search_EQ_dateType" :label="'day'">按日</el-radio>
                    <div class="clear1"></div>
                    <arrive-day v-show="search_EQ_dateType==='day'" ref="arriveDay"
                                @openArr="v=>arriveDetailOpen(v.day,'get','day')"></arrive-day>
                    <arrive-month v-show="search_EQ_dateType==='month'" ref="arriveMonth"
                                  @openArr="v=>arriveDetailOpen(v.month,'get','month')"></arrive-month>
                </el-col>
                <el-col :span="12">
                    <h3>发送量</h3>
                    <div class="clear1"></div>
                    <el-radio v-model="search_EQ_dateType1" :label="'month'">按月</el-radio>
                    <el-radio v-model="search_EQ_dateType1" :label="'day'">按日</el-radio>
                    <div class="clear1"></div>
                    <send-day v-show="search_EQ_dateType1==='day'" ref="sendDay"
                              @openArr="v=>arriveDetailOpen(v.day,'send','day')"></send-day>
                    <send-month v-show="search_EQ_dateType1==='month'" ref="sendMonth"
                                @openArr="v=>arriveDetailOpen(v.month,'send','month')"></send-month>
                </el-col>
            </el-row>
            <div class="clear1"></div>
            <div class="clear1"></div>
        </template>
        <template>
            <el-tabs v-model="panelName" @tab-click="handleClick">
                <el-tab-pane label="到达" name="arrive" v-if="power('WJOB_TRAIN_ARRIVE')">
                    <el-row>
                        <el-col :span="24">
                            <el-button type="primary" @click="handleDialogFormOpen"
                                       v-if="power('WJOB_TRAIN_ARRIVE:ADD')">
                                确报录入
                            </el-button>
                            <el-button type="primary" @click="checkPickUp" v-if="power('WJOB_TRAIN_ARRIVE:CONFIRM')">
                                接车确认
                            </el-button>
                            <auto-search-port-station placeholder="搜索发站"
                                                      @selectCode="v=>condition['search_EQ_stratStationCode']=v"></auto-search-port-station>

                            <el-input v-model="carnumber" placeholder="搜索车号" clearable style="width: 180px;"></el-input>
                            <el-button @click="loadData1">
                                查 询
                            </el-button>
                            <el-button @click="handleExportPort">导出Excel</el-button>
                            <excel-import code="" :btnName="yanBtnName" :isDownload="false" :isYanIn="true" @getUploadData="handleImport"></excel-import>

                        </el-col>
                    </el-row>
                    <el-form :inline="true" ref="form" :model="form" :rules="rules" class="add-form"
                             label-width="110px">
                        <base-list ref="portList" :condition="condition" :datas.sync="portList" :pageSearch="pageSearch"
                                   :isPaging="false">
                            <el-alert slot="search" v-if="multipleSelection.length>0"
                                      :title="'已选择'+multipleSelection.length+'条'" type="success">
                            </el-alert>
                            <el-table slot="list" :data="portList" border stripe max-height="500"
                                      @selection-change="handleSelectionChange">
                                <el-table-column type="selection" fixed="left" prop="id" width="50"></el-table-column>
                                <el-table-column type="index" fixed="left" label="序号" width="50"></el-table-column>
                                <el-table-column prop="wagonNo" fixed="left" label="车皮号" min-width="110">
                                </el-table-column>
                                <el-table-column prop="wagonSortNo" label="顺序号"></el-table-column>
                                <el-table-column prop="container" label="箱号" width="120">
                                    <template slot-scope="scope">

                                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                            <div style="padding-bottom:8px">
                                                {{scope.row.container[0].containerNo}}
                                            </div>
                                            <div class="table-line-diy"></div>
                                            <div style="padding-top:8px">
                                                {{scope.row.container[1].containerNo}}
                                            </div>
                                        </div>
                                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                            {{ scope.row.container[0].containerNo }}
                                        </div>
                                        <div v-else>

                                        </div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="container" label="尺寸" width="50">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                            <div style="padding-bottom:8px">
                                                {{scope.row.container[0].containerSize}}
                                            </div>
                                            <div class="table-line-diy"></div>
                                            <div style="padding-top:8px">
                                                {{scope.row.container[1].containerSize}}
                                            </div>
                                        </div>
                                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                            {{ scope.row.container[0].containerSize }}
                                        </div>
                                        <div v-else>

                                        </div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="container" label="箱型" width="50">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                            <div style="padding-bottom:8px">
                                                {{scope.row.container[0].containerType}}
                                            </div>
                                            <div class="table-line-diy"></div>
                                            <div style="padding-top:8px">
                                                {{scope.row.container[1].containerType}}
                                            </div>
                                        </div>
                                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                            {{ scope.row.container[0].containerType }}
                                        </div>
                                        <div v-else>

                                        </div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="container" label="空重" width="50">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                            <div style="padding-bottom:8px">
                                                {{scope.row.container[0].ifHeavy | _filterIfHeavyType}}
                                            </div>
                                            <div class="table-line-diy"></div>
                                            <div style="padding-top:8px">
                                                {{scope.row.container[1].ifHeavy | _filterIfHeavyType}}
                                            </div>
                                        </div>
                                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                            {{ scope.row.container[0].ifHeavy | _filterIfHeavyType}}
                                        </div>
                                        <div v-else>

                                        </div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="container" label="内外贸" width="70">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                            <div style="padding-bottom:8px">
                                                {{scope.row.container[0].tradeType | _filterTradeType}}
                                            </div>
                                            <div class="table-line-diy"></div>
                                            <div style="padding-top:8px">
                                                {{scope.row.container[1].tradeType | _filterTradeType}}
                                            </div>
                                        </div>
                                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                            {{ scope.row.container[0].tradeType | _filterTradeType}}
                                        </div>
                                        <div v-else>

                                        </div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="container" label="箱主" width="130">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                            <div style="padding-bottom:8px">
                                                {{scope.row.container[0].ownerName}}
                                            </div>
                                            <div class="table-line-diy"></div>
                                            <div style="padding-top:8px">
                                                {{scope.row.container[1].ownerName}}
                                            </div>
                                        </div>
                                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                            {{ scope.row.container[0].ownerName }}
                                        </div>
                                        <div v-else>

                                        </div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="container" label="货名" width="90">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                            <div style="padding-bottom:8px">
                                                {{scope.row.container[0].cargoName}}
                                            </div>
                                            <div class="table-line-diy"></div>
                                            <div style="padding-top:8px">
                                                {{scope.row.container[1].cargoName}}
                                            </div>
                                        </div>
                                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                            {{ scope.row.container[0].cargoName }}
                                        </div>
                                        <div v-else>

                                        </div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="container" label="货重" width="60">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                            <div style="padding-bottom:8px">
                                                {{scope.row.container[0].cargoWeight}}
                                            </div>
                                            <div class="table-line-diy"></div>
                                            <div style="padding-top:8px">
                                                {{scope.row.container[1].cargoWeight}}
                                            </div>
                                        </div>
                                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                            {{ scope.row.container[0].cargoWeight }}
                                        </div>
                                        <div v-else>

                                        </div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="stratStationName" label="发站" min-width="100">
                                </el-table-column>

                                <el-table-column prop="endStationName" label="到站" min-width="100">
                                </el-table-column>

                                <el-table-column prop="shipper" label="托运人" :show-overflow-tooltip="true"
                                                 min-width="120">
                                </el-table-column>
                                <el-table-column prop="shipperTel" label="联系电话" min-width="135">
                                </el-table-column>
                                <el-table-column prop="consignee" label="收货人" :show-overflow-tooltip="true"
                                                 min-width="120">
                                </el-table-column>
                                <el-table-column prop="consigneeTel" label="联系电话" min-width="135">
                                </el-table-column>

                                <el-table-column prop="options" fixed="right" align="center" label="操作" width="140"
                                                 :colpan="1" :rowspan="2">
                                    <template slot-scope="scope">
                                        <el-button type="text" size="small" @click="handleEdit(scope.row)"
                                                   v-if="power('WJOB_TRAIN_ARRIVE:UPD')&&!scope.row.emptied">
                                            编辑
                                        </el-button>
                                        <el-button type="text" class="danger" size="small"
                                                   @click="handleRemove(scope.row.planNo)"
                                                   v-if="power('WJOB_TRAIN_ARRIVE:DEL')">
                                            删除
                                        </el-button>
                                    </template>
                                </el-table-column>

                            </el-table>

                        </base-list>

                    </el-form>
                </el-tab-pane>

                <el-tab-pane v-loading.fullscreen.lock="loading" label="发送" name="send"
                             v-if="power('WJOB_TRAIN_DISPATCH')">
                    <base-list ref="sendList" :showLine="false" :condition="condition2" :datas.sync="sendList"
                               :pageSearch="pageSearch2" :isPaging="false">
                        <div slot="search">
                            <el-form :inline="true" :model="condition2" class="search-form" label-width="80px">
                                <el-row>
                                    <el-col :span="8">
                                        <el-form-item label="车皮号">
                                            <el-input v-model="condition2['search_LIKE_wagonNo']" clearable></el-input>
                                        </el-form-item>
                                    </el-col>
                                    <el-col :span="8">
                                        <el-form-item label="到站">
                                            <el-input v-model="Arrival" clearable></el-input>
                                        </el-form-item>
                                    </el-col>
                                    <!--<el-col :span="8">-->
                                    <!--<el-form-item label="到站">-->
                                    <!--<auto-search-port-station @selectCode="v=>condition2['search_EQ_endStationCode']=v"></auto-search-port-station>-->
                                    <!--</el-form-item>-->
                                    <!--</el-col>-->
                                    <!--<el-col :span="8">-->
                                    <!--<el-form-item label="空重" prop="name">-->
                                    <!--<el-select v-model="condition2['search_EQ_ifHeavy']" placeholder="请选择空重" clearable>-->
                                    <!--<el-option v-for="[key, val] in _dictIfHeavyType" :key="key" :label="val" :value="key">-->
                                    <!--</el-option>-->
                                    <!--</el-select>-->
                                    <!--</el-form-item>-->
                                    <!--</el-col>-->
                                    <el-col :span="8">
                                        <el-button type="primary" @click="handleSend"
                                                   v-if="power('WJOB_TRAIN_DISPATCH:SEND')">
                                            发 送
                                        </el-button>
                                        <el-button icon="el-icon-search" type="primary" @click="loadData3"
                                                   v-if="power('WJOB_TRAIN_DISPATCH:QUERY')">
                                            查 询
                                        </el-button>
                                        <el-button @click="handleExport">导出Excel</el-button>
                                        <!--<el-button @click="loadData2" v-if="power('WJOB_TRAIN_DISPATCH:QUERY')">-->
                                        <!--刷 新-->
                                        <!--</el-button>-->
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <!--<el-col :span="8">-->
                                    <!--<el-form-item label="货名">-->
                                    <!--<el-input v-model="condition2['search_LIKE_cargoName']" clearable></el-input>-->
                                    <!--</el-form-item>-->
                                    <!--</el-col>-->
                                    <!--<el-col :span="8">-->
                                    <!--<el-form-item label="尺寸">-->
                                    <!--<autoSearchSize v-model="condition2['search_LIKE_containerSize']"></autoSearchSize>-->
                                    <!--</el-form-item>-->
                                    <!--</el-col>-->

                                </el-row>
                            </el-form>
                            <el-row type="flex" justify="end" class="mt-10">
                                <el-col :span="16" style="display: flex;justify-content: space-between">
                                    <title-point color="#30C8CA">
                                        <div slot="content">
                                            车皮数 :
                                            <span style="font-size: 16px">{{ sendCount.wagon }}</span>
                                        </div>
                                    </title-point>
                                    <title-point color="#449DFF">
                                        <div slot="content">
                                            箱个数 :
                                            <span style="font-size: 16px">{{ sendCount.container }}</span></div>
                                    </title-point>
                                    <title-point color="#50B155">
                                        <div slot="content">
                                            重箱个数 :
                                            <span style="font-size: 16px;">{{ sendCount.F }}</span></div>
                                    </title-point>
                                    <title-point color="#30C8CA">
                                        <div slot="content">
                                            空箱个数 :
                                            <span style="font-size: 16px;">{{ sendCount.E  }} </span>
                                        </div>
                                    </title-point>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-alert v-if="multipleSelection2.length>0"
                                          :title="'已选择'+multipleSelection2.length+'条'" type="success">
                                </el-alert>
                            </el-row>
                        </div>
                        <el-table slot="list" :data="sendList" border stripe max-height="500" :span-method="objecSend"
                                  @selection-change="handleSelectionChange2">
                            <el-table-column type="selection" fixed="left" prop="id" width="55"></el-table-column>
                            <el-table-column type="index" fixed="left" label="序号" width="50"></el-table-column>
                            <el-table-column fixed="left" prop="wagonNo" label="车皮号" 
                                             min-width="110"></el-table-column>
                            <el-table-column prop="containerNo" label="箱号"  min-width="120">
                                <template slot-scope="scope">
                                    <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                        <div style="padding-bottom:8px">
                                            {{scope.row.container[0].containerNo}}
                                        </div>
                                        <div class="table-line-diy"></div>
                                        <div style="padding-top:8px">
                                            {{scope.row.container[1].containerNo}}
                                        </div>
                                    </div>
                                    <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                        {{ scope.row.container[0].containerNo }}
                                    </div>
                                    <div v-else>

                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="containerSize" label="尺寸"  min-width="120">
                                <template slot-scope="scope">
                                    <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                        <div style="padding-bottom:8px">
                                            {{scope.row.container[0].containerSize}}
                                        </div>
                                        <div class="table-line-diy"></div>
                                        <div style="padding-top:8px">
                                            {{scope.row.container[1].containerSize}}
                                        </div>
                                    </div>
                                    <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                        {{ scope.row.container[0].containerSize }}
                                    </div>
                                    <div v-else>

                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="ifHeavy" label="空重"  min-width="120">
                                <template slot-scope="scope">
                                    <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                        <div style="padding-bottom:8px">
                                            {{scope.row.container[0].ifHeavy | _filterIfHeavyType}}
                                        </div>
                                        <div class="table-line-diy"></div>
                                        <div style="padding-top:8px">
                                            {{scope.row.container[1].ifHeavy | _filterIfHeavyType}}
                                        </div>
                                    </div>
                                    <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                        {{ scope.row.container[0].ifHeavy | _filterIfHeavyType}}
                                    </div>
                                    <div v-else>

                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="cargoName" label="货名"  min-width="120">
                                <template slot-scope="scope">
                                    <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                        <div style="padding-bottom:8px">
                                            {{scope.row.container[0].cargoName}}
                                        </div>
                                        <div class="table-line-diy"></div>
                                        <div style="padding-top:8px">
                                            {{scope.row.container[1].cargoName}}
                                        </div>
                                    </div>
                                    <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                        {{ scope.row.container[0].cargoName }}
                                    </div>
                                    <div v-else>

                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="cargoWeight" label="货重"  min-width="120">
                                <template slot-scope="scope">
                                    <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                        <div style="padding-bottom:8px">
                                            {{scope.row.container[0].cargoWeight}}
                                        </div>
                                        <div class="table-line-diy"></div>
                                        <div style="padding-top:8px">
                                            {{scope.row.container[1].cargoWeight}}
                                        </div>
                                    </div>
                                    <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                        {{ scope.row.container[0].cargoWeight }}
                                    </div>
                                    <div v-else>

                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="stratStationName" label="发站"  min-width="120">
                                <template slot-scope="scope">
                                    <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                        <div style="padding-bottom:8px">
                                            {{scope.row.container[0].stratStationName}}
                                        </div>
                                        <div class="table-line-diy"></div>
                                        <div style="padding-top:8px">
                                            {{scope.row.container[1].stratStationName}}
                                        </div>
                                    </div>
                                    <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                        {{ scope.row.container[0].stratStationName }}
                                    </div>
                                    <div v-else>

                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="endStationName" label="到站"  min-width="120">
                                <template slot-scope="scope">
                                    <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                        <div style="padding-bottom:8px">
                                            {{scope.row.container[0].endStationName}}
                                        </div>
                                        <div class="table-line-diy"></div>
                                        <div style="padding-top:8px">
                                            {{scope.row.container[1].endStationName}}
                                        </div>
                                    </div>
                                    <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                        {{ scope.row.container[0].endStationName }}
                                    </div>
                                    <div v-else>

                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="commander" label="指挥手"  min-width="120">
                                <template slot-scope="scope">
                                    <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                        <div style="padding-bottom:8px">
                                            {{scope.row.container[0].commander}}
                                        </div>
                                        <div class="table-line-diy"></div>
                                        <div style="padding-top:8px">
                                            {{scope.row.container[1].commander}}
                                        </div>
                                    </div>
                                    <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                        {{ scope.row.container[0].commander }}
                                    </div>
                                    <div v-else>

                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="driverName" label="作业司机"  min-width="120">
                                <template slot-scope="scope">
                                    <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                        <div style="padding-bottom:8px">
                                            {{scope.row.container[0].driverName}}
                                        </div>
                                        <div class="table-line-diy"></div>
                                        <div style="padding-top:8px">
                                            {{scope.row.container[1].driverName}}
                                        </div>
                                    </div>
                                    <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                        {{ scope.row.container[0].driverName }}
                                    </div>
                                    <div v-else>

                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="machineName" label="作业机械"  min-width="120">
                                <template slot-scope="scope">
                                    <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                        <div style="padding-bottom:8px">
                                            {{scope.row.container[0].machineName}}
                                        </div>
                                        <div class="table-line-diy"></div>
                                        <div style="padding-top:8px">
                                            {{scope.row.container[1].machineName}}
                                        </div>
                                    </div>
                                    <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                        {{ scope.row.container[0].machineName }}
                                    </div>
                                    <div v-else>

                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="jobTime" label="装车时间"  min-width="160">
                                <template slot-scope="scope">
                                    <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                                        <div style="padding-bottom:8px">
                                            {{scope.row.container[0].jobTime}}
                                        </div>
                                        <div class="table-line-diy"></div>
                                        <div style="padding-top:8px">
                                            {{scope.row.container[1].jobTime}}
                                        </div>
                                    </div>
                                    <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                                        {{ scope.row.container[0].jobTime }}
                                    </div>
                                    <div v-else>

                                    </div>
                                </template>

                            </el-table-column>
                            <el-table-column prop="arrivalTime" label="车皮进港时间"  min-width="160">
                            </el-table-column>
                            <el-table-column fixed="right" align="center" label="操作"  width="140">
                                <template slot-scope="scope"
                                          v-if="scope.row.container!==null">
                                    <el-button size="small" type="text" @click="Tocargo(scope.row)"
                                               v-if="scope.row.container[0].ifHeavy != '' && power('WJOB_TRAIN_DISPATCH:CHANGEWEIGHT')">
                                        改货重
                                    </el-button>

                                </template>
                            </el-table-column>
                        </el-table>
                    </base-list>

                </el-tab-pane>
                <!-- 二期代码屏蔽 -->
                <!--<el-tab-pane label="对轨配组" name="pair">-->
                <!--<pair></pair>-->
                <!--</el-tab-pane>-->
            </el-tabs>
        </template>
        <Tocar ref="Tocar" @aaa="loadData"></Tocar>
        <arrive-form ref="arriveForm" @savesuccess="_savesuccess"></arrive-form>

        <arrive-detail ref="arriveDetail"></arrive-detail>

        <el-dialog title="确认弹窗" :visible.sync="pickUpDialog" :lock-scroll="true" :modal="false" width="1100px">
            <el-form :inline="true" ref="pick" :model="pick" class="add-form" label-width="110px">
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="接车时间：">
                            <el-date-picker v-model="startRecord" value-format="yyyy-MM-dd HH:mm:ss" type="datetime"
                                            placeholder="选择日期"></el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="车皮号：">
                            <el-input ref="pickWagonNo" style="width: 188px" v-model="pickWagonNo"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row type="flex" justify="space-between">
                    <el-col :span="10">
                        <div style="display: flex;justify-content: space-between">
                            <span>未排序列表</span>
                            <span style="color: #33CCCC;">提示：双击行跳转到已排序列表</span>
                        </div>
                        <el-table :data="pickTable" border max-height="500" min-height="500"
                                  style="cursor: pointer;user-select: none;-moz-user-select: none;-ms-user-select: none;-webkit-user-select: none"
                                  @row-dblclick="dbclickPick"
                                  @row-click="clickPick">
                            <el-table-column label="序号" width="50">
                                <template slot-scope="scope">
                                    <div v-bg="scope.row.isSelect">
                                        {{ scope.$index + 1 }}
                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="wagonNo" label="车皮号">
                                <template slot-scope="scope">
                                    <div v-bg="scope.row.isSelect">
                                        {{ scope.row.wagonNo }}
                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="stratStationName" label="发站">
                                <template slot-scope="scope">
                                    <div v-bg="scope.row.isSelect">
                                        {{ scope.row.stratStationName }}
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-col>
                    <el-col :span="2"
                            style="display: flex;justify-content: center;align-items: center;flex-direction: column;">
                        <div style="margin-bottom: 10px">
                            <el-button :disabled="pickTable.length===0" @click="rightPick(selectPickTable)"
                                       icon="el-icon-d-arrow-right"></el-button>
                        </div>
                        <div>
                            <el-button @click="leftPick(selectPickTableEd)" :disabled="pickTableEd.length===0"
                                       icon="el-icon-d-arrow-left"></el-button>
                        </div>
                    </el-col>
                    <el-col :span="10">
                        <div style="display: flex;justify-content: space-between">
                            <span>已排序列表</span>
                            <span style="color: #9900FF;">共{{ multipleSelection.length }}节</span>
                            <span style="color: #9900FF;">已排序{{ pickTableEd.length }}节</span>
                            <span style="color: #9900FF;">未排序{{ pickTable.length }}节</span>
                        </div>
                        <el-table :data="pickTableEd" border max-height="500" min-height="500"
                                  style="cursor: pointer;user-select: none;-moz-user-select: none;-ms-user-select: none;-webkit-user-select: none"
                                  @row-dblclick="dbclickPickEd"
                                  @row-click="clickPickEd">
                            <el-table-column prop="wagonSortNo" label="进港顺序" width="80">
                                <template slot-scope="scope">
                                    <div v-bg="scope.row.isClick">
                                        {{ scope.$index +1 }}
                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="wagonNo" label="车皮号">
                                <template slot-scope="scope">
                                    <div v-bg="scope.row.isClick">
                                        {{ scope.row.wagonNo }}
                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="stratStationName" label="发站">
                                <template slot-scope="scope">
                                    <div v-bg="scope.row.isClick">
                                        {{ scope.row.stratStationName }}
                                    </div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-col>
                    <el-col :span="2"
                            style="display: flex;justify-content: center;align-items: center;flex-direction: column;">
                        <div style="margin-bottom: 10px">
                            <el-button @click="pickUpEd" :disabled="pickTableEd.length===0">上移</el-button>
                        </div>
                        <div>
                            <el-button @click="pickDownEd" :disabled="pickTableEd.length===0">下移</el-button>
                        </div>
                    </el-col>
                </el-row>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="pickUpDialog = false">取 消</el-button>
                <el-button type="primary" @click="pickUp" :loading="$store.getters.loadingBtn">确 定</el-button>
            </div>
        </el-dialog>

        <el-dialog title="确认弹窗" :visible.sync="pickUpNewDialog" :lock-scroll="true" :modal="false" width="360px">
            <el-form label-width="110px">
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="接车时间：">
                            <el-date-picker v-model="startNewRecord" value-format="yyyy-MM-dd HH:mm:ss" type="datetime"
                                            placeholder="选择日期"></el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="pickUpNewDialog = false">取 消</el-button>
                <el-button type="primary" @click="pickUpNew" :loading="$store.getters.loadingBtn">确 定</el-button>
            </div>
        </el-dialog>

        <el-dialog title="确认弹窗" :visible.sync="sendUpDialog" :modal="false" :modal-append-to-body="false" width="1100px"
                   style="margin-top: 8vh;">
            <el-row>
                <el-col :span="24">
                    <label>发送时间：</label>
                    <el-date-picker v-model="sendDate" value-format="yyyy-MM-dd HH:mm:ss" type="datetime"
                                    placeholder="选择日期"></el-date-picker>
                </el-col>
            </el-row>
            <el-table :data="multipleSelection2" border stripe max-height="500" class="mt-20">
                <el-table-column fixed="left" prop="wagonNo" label="车皮号"  min-width="110"></el-table-column>
                <el-table-column prop="containerNo" label="箱号"  min-width="120">
                    <template slot-scope="scope">
                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                            <div style="padding-bottom:8px">
                                {{scope.row.container[0].containerNo}}
                            </div>
                            <div class="table-line-diy"></div>
                            <div style="padding-top:8px">
                                {{scope.row.container[1].containerNo}}
                            </div>
                        </div>
                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                            {{ scope.row.container[0].containerNo }}
                        </div>
                        <div v-else>

                        </div>
                    </template>
                </el-table-column>
                <el-table-column prop="containerSize" label="尺寸"  min-width="120">
                    <template slot-scope="scope">
                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                            <div style="padding-bottom:8px">
                                {{scope.row.container[0].containerSize}}
                            </div>
                            <div class="table-line-diy"></div>
                            <div style="padding-top:8px">
                                {{scope.row.container[1].containerSize}}
                            </div>
                        </div>
                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                            {{ scope.row.container[0].containerSize }}
                        </div>
                        <div v-else>

                        </div>
                    </template>
                </el-table-column>
                <el-table-column prop="ifHeavy" label="空重"  min-width="120">
                    <template slot-scope="scope">
                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                            <div style="padding-bottom:8px">
                                {{scope.row.container[0].ifHeavy | _filterIfHeavyType}}
                            </div>
                            <div class="table-line-diy"></div>
                            <div style="padding-top:8px">
                                {{scope.row.container[1].ifHeavy | _filterIfHeavyType}}
                            </div>
                        </div>
                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                            {{ scope.row.container[0].ifHeavy | _filterIfHeavyType}}
                        </div>
                        <div v-else>

                        </div>
                    </template>
                </el-table-column>
                <el-table-column prop="cargoName" label="货名"  min-width="120">
                    <template slot-scope="scope">
                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                            <div style="padding-bottom:8px">
                                {{scope.row.container[0].cargoName}}
                            </div>
                            <div class="table-line-diy"></div>
                            <div style="padding-top:8px">
                                {{scope.row.container[1].cargoName}}
                            </div>
                        </div>
                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                            {{ scope.row.container[0].cargoName }}
                        </div>
                        <div v-else>

                        </div>
                    </template>
                </el-table-column>
                <el-table-column prop="cargoWeight" label="货重"  min-width="120">
                    <template slot-scope="scope">
                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                            <div style="padding-bottom:8px">
                                {{scope.row.container[0].cargoWeight}}
                            </div>
                            <div class="table-line-diy"></div>
                            <div style="padding-top:8px">
                                {{scope.row.container[1].cargoWeight}}
                            </div>
                        </div>
                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                            {{ scope.row.container[0].cargoWeight }}
                        </div>
                        <div v-else>

                        </div>
                    </template>
                </el-table-column>
                <el-table-column prop="stratStationName" label="发站"  min-width="120">
                    <template slot-scope="scope">
                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                            <div style="padding-bottom:8px">
                                {{scope.row.container[0].stratStationName}}
                            </div>
                            <div class="table-line-diy"></div>
                            <div style="padding-top:8px">
                                {{scope.row.container[1].stratStationName}}
                            </div>
                        </div>
                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                            {{ scope.row.container[0].stratStationName }}
                        </div>
                        <div v-else>

                        </div>
                    </template>
                </el-table-column>
                <el-table-column prop="endStationName" label="到站"  min-width="120">
                    <template slot-scope="scope">
                        <div v-if="scope.row.container!==null&&scope.row.container.length===2">
                            <div style="padding-bottom:8px">
                                {{scope.row.container[0].endStationName}}
                            </div>
                            <div class="table-line-diy"></div>
                            <div style="padding-top:8px">
                                {{scope.row.container[1].endStationName}}
                            </div>
                        </div>
                        <div v-else-if="scope.row.container!==null&&scope.row.container.length===1">
                            {{ scope.row.container[0].endStationName }}
                        </div>
                        <div v-else>

                        </div>
                    </template>
                </el-table-column>
                <el-table-column prop="arrivalTime" label="车皮进港时间"  min-width="160">
                </el-table-column>
            </el-table>
            <div slot="footer" class="dialog-footer">
                <el-button @click="sendUpDialog = false">取 消</el-button>
                <el-button @click="handleExportSend">导 出</el-button>
                <el-button type="primary" @click="sendArr">确 定</el-button>
            </div>
        </el-dialog>

    </div>
</template>


<script>
    import arriveForm from "./arriveForm";
    import arriveDetail from "./arriveDetail";
    import pair from "./pair";
    import {
        acceptanceConfirmation,
        arrive,
        arriveList,
        delArrive,
        depart,
        getGatePanelInfo,
        receive,
        sendList,
        sendOut,
        trainJobPlanSendListCount,
        imptForDelayData
    } from "@/api/gatePanel/gatePanel";
    import { approval } from "@/api/workflow/workflow";
    import searchCustom from "@/components/autocomplete/autoSearchCustom";
    import autoSearchCustom from "@/components/autocomplete/autoSearchCustom";
    import { PUBLIC_LIMIT, REG_TEXT } from "@/utils/Reg";
    import { sortLength } from "@/utils/rules";
    import { getLocalTime } from "@/utils/dateFormat";
    import { companyNature, customType } from "@/assets/dict";
    import autoSearchPortStation from "@/components/autocomplete/autoSearchPortStation";
    import autoSearchSize from "@/components/autocomplete/autoSearchSize";
    import autoSearchEntrust from "@/components/autocomplete/autoSearchEntrust";
    import arriveDay from "./arriveDay";
    import arriveMonth from "./arriveMonth";
    import sendDay from "./sendDay";
    import sendMonth from "./sendMonth";
    import { newExportExcel } from "@/utils/newExport";
    import { ifHeavyType, tradeType } from "@/assets/dict";
    import titlePoint from '../common/title-point';
    import Tocar from '../system/Tocargo';
    import excelImport from '@/components/excel/import';

    function swapArray(arr, index1, index2) {
        arr[index1] = arr.splice(index2, 1, arr[index1])[0];
        return arr;
    }

    export default {
        name: "gatePanelPage",
        components: {
            arriveForm,
            searchCustom,
            arriveDetail,
            autoSearchPortStation,
            autoSearchSize,
            autoSearchEntrust,
            autoSearchCustom,
            arriveDay,
            arriveMonth,
            sendDay,
            sendMonth,
            pair,
            titlePoint,
            Tocar,
            excelImport
        },
        data() {
            return {
                yanBtnName:"延站数据导入",
                pick: {
                    wagonNo: '',
                },
                pickWagonNo: '',
                pickUpDialog: false, // 接车录入弹窗
                pickUpNewDialog : false,
                sendUpDialog: false, // 发送弹窗
                condition: {
                    search_IN_status: "NOOPERATE,OPERATING"
                }, // 查询条件
                pageSearch: arriveList, // 分页查询api接口,
                portList: [],
                portLists: [],
                portList2: [],
                condition2: {}, // 查询条件
                pageSearch2: sendList, // 分页查询api接口,
                sendList: [],
                sendLists: [],
                sendList2: [],
                startNewRecord : getLocalTime(+new Date(), "YYYY-MM-DD hh:mm:ss"),
                startRecord: getLocalTime(+new Date(), "YYYY-MM-DD hh:mm:ss"), //接车时间
                sendDate: getLocalTime(+new Date(), "YYYY-MM-DD hh:mm:ss"), //发送时间
                form: {},
                panelName: "arrive", //tab name
                dateType: true,
                search_EQ_dateType: "day",
                search_GTE_dateTime: "",
                search_EQ_dateType1: "day",
                search_GTE_dateTime1: "",
                selectDate: "",
                years: [],
                year: 0, //接运量（按日） 年
                month: 0, //接运量（按日） 月
                day: 1, //日
                year1: 0, //发送量（按日） 年
                month1: 0, //发送量（按日） 月
                year2: 0, //接运量（按月） 年
                year3: 0, //发送量（按月） 年
                calendarData: [], //接运量（按月）日历数据
                calendarData1: [], //发送量（按月）日历数据

                multipleSelection: [],
                multipleSelection2: [],
                rules: {},
                loading: false,
                isClick: true,
                sendCount: {},
                pickTable: [],
                pickTableEd: [],
                selectPickTable: {},
                selectPickTableEd: {},

                carnumber: '',
                orgArr: {},

                Arrival: '',
                pullArr: {},
                formVisible: false,

            };
        },
        directives: {
            bg: {
                inserted(el, binding) {
                    if (binding.value) {
                        el.parentNode.parentNode.style.backgroundColor = '#409eff'
                    } else {
                        el.parentNode.parentNode.style.backgroundColor = '#ffffff'
                    }
                },
                update(el, binding) {
                    if (binding.value) {
                        el.parentNode.parentNode.style.backgroundColor = '#409eff'
                    } else {
                        el.parentNode.parentNode.style.backgroundColor = '#ffffff'
                    }
                },
            }
        },
        mounted() {
            this.loadData();
            document.onkeydown = (e => {
                if (this.pickUpDialog) {
                    if (e.keyCode === 13) {
                        this.rightPick(this.selectPickTable)
                    }
                    if (e.keyCode === 38) {
                        this.upOrDown(true)
                    }
                    if (e.keyCode === 40) {
                        this.upOrDown(false)
                    }
                }

            })
        },
        methods: {
            _savesuccess() {
                //监听子弹窗保存成功
                this.loadData();
                this.$refs.arriveDay.getMonthDay();
                this.$refs.arriveMonth.getMonthDay();
                this.$refs.sendDay.getMonthDay();
                this.$refs.sendMonth.getMonthDay();
            },

            objectSpanMethod({ row, column, rowIndex, columnIndex }) {
                if (
                    // column.property == "id" ||
                    column.property == "wagonNo" ||
                    column.property == "shipper" ||
                    column.property == "shipperTel" ||
                    column.property == "consignee" ||
                    column.property == "consigneeTel" ||
                    column.property == "options"
                ) {
                    if (row.merge) {
                        //合并当前行
                        return {
                            rowspan: 2,
                            colspan: 1
                        };
                    } else if (row.merged) {
                        //标记当前为已合并
                        return {
                            rowspan: 0,
                            colspan: 0
                        };
                    }
                }
            },
            objecSend({ row, column, rowIndex, columnIndex }) {
                if (
                    column.property == "id" ||
                    column.property == "wagonNo" ||
                    column.property == "options"
                ) {
                    if (row.merge) {
                        //合并当前行
                        return {
                            rowspan: 2,
                            colspan: 1
                        };
                    } else if (row.merged) {
                        //标记当前为已合并
                        return {
                            rowspan: 0,
                            colspan: 0
                        };
                    }
                }
            },
            loadData() {
                this.$refs.portList.loadData().then(() => {
                    this.orgArr = JSON.parse(JSON.stringify(this.portList));
                })

                this.$refs.sendList.loadData().then(() => {
                    this.pullArr = JSON.parse(JSON.stringify(this.sendList));
                })


            },

            loadData1() {
                this.portList = [];
                console.log(this.condition['search_EQ_stratStationCode'])
                if (this.condition['search_EQ_stratStationCode'] && this.carnumber) {
                    this.orgArr.forEach(el => {
                        if (el.stratStationCode === this.condition['search_EQ_stratStationCode']&&el.wagonNo.indexOf(this.carnumber)!==-1) {
                            this.portList.push(el)
                        }
                    })

                }


                if (this.condition['search_EQ_stratStationCode'] && !this.carnumber) {
                    this.orgArr.forEach(el => {
                        if (el.stratStationCode === this.condition['search_EQ_stratStationCode']) {
                            this.portList.push(el)
                        }
                    })
                }

                if (this.carnumber && !this.condition['search_EQ_stratStationCode']) {
                    this.orgArr.forEach(el => {
                        if (el.wagonNo.indexOf(this.carnumber)!==-1) {
                            this.portList.push(el)
                        }
                    })
                }

                if (!this.carnumber && !this.condition['search_EQ_stratStationCode']) {
                    this.$refs.portList.loadData().then(() => {
                        this.orgArr = JSON.parse(JSON.stringify(this.portList));
                    })
                }


            },


            loadData2() {

                let params = this.$assist.copySearchConditions(this.condition2)
                trainJobPlanSendListCount(params).then(res => {
                    this.sendCount = res.data
                })
            },
            loadData3() {
                console.log(this.condition2['search_LIKE_wagonNo'], this.Arrival)
                this.sendList = [];

                if (this.condition2['search_LIKE_wagonNo'] && this.Arrival) {
                    this.pullArr.forEach(el => {
                        if (el.wagonNo === this.condition2['search_LIKE_wagonNo']) {
                            if (el.container && el.container[0].endStationName.indexOf(this.Arrival)!==-1) {
                                this.sendList.push(el)
                            }
                        }
                    })
                }


                if (this.condition2['search_LIKE_wagonNo'] && !this.Arrival) {
                    this.pullArr.forEach(el => {
                        if (el.wagonNo === this.condition2['search_LIKE_wagonNo']) {
                            this.sendList.push(el)
                        }
                    })
                }

                if (this.Arrival && !this.condition2['search_LIKE_wagonNo']) {
                    this.pullArr.forEach(el => {
                        if (el.container && el.container[0].endStationName.indexOf(this.Arrival)!==-1) {
                            this.sendList.push(el)
                        }
                    })
                }

                if (!this.Arrival && !this.condition2['search_LIKE_wagonNo']) {
                    this.$refs.sendList.loadData().then(() => {
                        this.pullArr = JSON.parse(JSON.stringify(this.sendList));
                    })

                }
            },
            sendData(data, type) {
                if (type === "send") {
                    this.sendList = this.setData(data);
                    this.sendList2 = this.setData(data);
                } else {
                    this.portList = this.setData(data);
                    this.portList2 = this.setData(data);
                }
            },
            setData(data) {
                console.log(data);
                let _tmp = data;
                for (let i = 0; i < _tmp.length; i++) {
                    //默认只有2条会重复
                    if (i % 2 == 1) {
                        //查询前一条数据
                        if (_tmp[i - 1].wagonNo == _tmp[i].wagonNo) {
                            //标记前一条数据为合并
                            _tmp[i - 1].merge = true;
                            //标记当前数据为已合并数据
                            _tmp[i].merged = true;
                        }
                        //查询后一条数据
                        if (_tmp[i + 1]) {
                            if (_tmp[i + 1].wagonNo == _tmp[i].wagonNo) {
                                //标记当前数据为合并
                                _tmp[i].merge = true;
                                //标记后一条数据为已合并数据
                                _tmp[i + 1].merged = true;
                            }
                        }
                    }
                    //- 追加options参数,判断最后是否有操作按钮
                    _tmp[i].options = "";
                }
                return _tmp;
            },
            checkPickUp() {
                let _arr = this.multipleSelection;
                console.log(_arr)
                if (!_arr.length) {
                    this.$message({
                        message: "至少选择一条数据!",
                        type: "error"
                    });
                    return;
                }
                let isGoNew = 1;
                _arr.forEach((column, index) => {
                    if (column.wagonSortNo == 0){
                        isGoNew = 0;
                    }
                })
                if (isGoNew == 1){
                    this.pickUpNewDialog = true;
                } else {
                    let tableIng = [];
                    let tableEd = [];
                    _arr.forEach((column, index) => {
                        if (column.wagonSortNo == 0){
                            tableIng.push(column)
                        } else {
                            tableEd.push(column)
                        }
                    })
                    if (this.isClick) {
                        this.isClick = false
                        this.pickTable = this.$assist.deepcopy(tableIng)
                        this.pickTableEd = this.$assist.deepcopy(tableEd)
                        this.pickUpDialog = true;
                        this.pickTable.splice(0, 1, { ...this.pickTable[0], isSelect: true })
                        this.selectPickTable = this.pickTable[0]
                    }
                }

            },
            pickUpNew() {
                let _arr = this.multipleSelection;
                let planNo = [];
                _arr.forEach((column, index) => {
                    planNo.push({ planNo: column.planNo, wagonSortNo: column.wagonSortNo});
                })
                let data = {
                    startRecord: this.startNewRecord,
                    wagonJobPlan: planNo
                };
                acceptanceConfirmation(data).then(res => {
                    this.$message({ message: "接车成功!", type: "success" });
                    this.loadData();
                    this._savesuccess();
                    this.pickUpNewDialog = false;
                });
            },
            pickUp() {
                // let _arr = this.multipleSelection;
                // let __arr = [];
                // for (let i = 0; i < _arr.length; i++) {
                //   let _no = _arr[i].planNo;

                //   __arr.push(_arr[i]);
                //   //存在合并项
                //   if (_arr[i].merge) {
                //     let ___arr = this.portList2.filter(item => {
                //       return item.planNo == _no;
                //     });
                //     if (___arr.length > 0) {
                //       __arr.push(___arr[___arr.length - 1]);
                //     }
                //   }
                // }
                // if (!_arr.length) {
                //   this.$message({
                //     message: "至少选择一条数据!",
                //     type: "error"
                //   });
                //   return;
                // }
                // let _data = {};
                // _data.startRecord = this.startRecord;
                // _data.container = [];
                // for (let i = 0; i < __arr.length; i++) {
                //   _data.container.push({
                //     planNo: __arr[i].planNo,
                //     planDetailId: __arr[i].planDetailId,
                //     wagonNo: __arr[i].wagonNo,
                //     shipper: __arr[i].shipper,
                //     shipperTel: __arr[i].shipperTel,
                //     consignee: __arr[i].consignee,
                //     consigneeTel: __arr[i].consigneeTel,
                //     containerNo: __arr[i].containerNo,
                //     containerSize: __arr[i].containerSize,
                //     containerType: __arr[i].containerType,
                //     ifHeavy: __arr[i].ifHeavy,
                //     tradeType: __arr[i].tradeType,
                //     sealNumber: __arr[i].sealNumber,
                //     stratStationCode: __arr[i].stratStationCode,
                //     stratStationName: __arr[i].stratStationName,
                //     endStationCode: __arr[i].endStationCode,
                //     endStationName: __arr[i].endStationName,
                //     cargoName: __arr[i].cargoName,
                //     cargoWeight: __arr[i].cargoWeight,
                //     ownerName: __arr[i].ownerName,
                //     ownerId: __arr[i].ownerId
                //   });
                // }
                if (this.pickTableEd.length === 0) {
                    this.$message({ message: '请先排序!', type: 'error' })
                    return
                }
                let planNo = [];
                this.pickTableEd.forEach((element, index) => {
                    planNo.push({ planNo: element.planNo, wagonSortNo: index + 1 });
                });
                let data = {
                    startRecord: this.startRecord,
                    wagonJobPlan: planNo
                };
                acceptanceConfirmation(data).then(res => {
                    this.$message({ message: "接车成功!", type: "success" });
                    this.loadData();
                    this._savesuccess();
                    this.pickUpDialog = false;
                });
            },
            handleRemove(id) {
                this.$confirm(`是否删除该条数据?`, "提示", {
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    type: "warning"
                })
                    .then(() => {
                        delArrive(id).then(res => {
                            this.$message({
                                message: "删除成功!",
                                type: "success"
                            });
                            this.loadData();
                            this._savesuccess();
                        });
                    })
                    .catch(() => {
                        this.$message({
                            type: "info",
                            message: "已取消"
                        });
                    });
            },
            // get selections
            handleSelectionChange(val) {
                console.log(val);
                this.multipleSelection = val;
            },
            // get selections
            handleSelectionChange2(val) {
                this.multipleSelection2 = val;
            },
            sendArr() {
                console.log(this.multipleSelection2);
                //批量发送
                if (this.multipleSelection2.length < 1) {
                    this.$message({
                        message: `请先选择一条数据`,
                        type: "error"
                    });
                    return;
                }
                let data = {};
                data.sendDate = this.sendDate;
                data.container = [];
                for (let i = 0; i < this.multipleSelection2.length; i++) {
                    data.container.push({
                        planNo: this.multipleSelection2[i].planNo
                        // wagonNo: this.multipleSelection2[i].wagonNo,
                        // containerNo: this.multipleSelection2[i].containerNo,
                        // containerSize: this.multipleSelection2[i].containerSize,
                        // ifHeavy: this.multipleSelection2[i].ifHeavy,
                        // stratStationName: this.multipleSelection2[i].stratStationName,
                        // endStationName: this.multipleSelection2[i].endStationName,
                        // cargoName: this.multipleSelection2[i].cargoName,
                        // containerType: this.multipleSelection2[i].containerType,
                    });
                }
                depart(data).then(res => {
                    this.$message({ message: "发送成功!", type: "success" });
                    this.sendUpDialog = false;
                    this.loadData2();
                    this._savesuccess();
                });
            },
            keyEnter(i, e) {
                // console.log('--------- keyEnter -----------')
                // console.log(i)
                // console.log(e)
            },
            // del row
            handleDelTable() {
                if (this.multipleSelection.length > 0) {
                    this.form.contractCargo = this.form.contractCargo.filter(f => {
                        return !this.multipleSelection.includes(f);
                    });
                } else {
                    this.$message({
                        message: `请先选择一条数据`,
                        type: "error"
                    });
                }
            },
            //- click tabs
            handleClick(tab, event) {
                if (tab.name == "send") {
                    this.loadData2();
                } else {
                    this.loadData();
                }
            },
            // 打开日历 （按日）
            arriveDetailOpen(date, type, method) {
                this.$refs.arriveDetail.dialogForm = true;
                this.$refs.arriveDetail.loadData(date + ' 00:00:00', date + ' 23:59:59', type, method);
            },
            // click open
            handleDialogFormOpen() {
                this.$refs.arriveForm.dialogForm = true;
                this.$refs.arriveForm.isEdit = false;
            },
            handleEdit(item) {
                getGatePanelInfo(item.planNo).then(res => {
                    this.$refs.arriveForm.isEdit = true;
                    if (res.data.container.length === 2) {
                        this.$refs.arriveForm.form = res.data;
                    } else {
                        this.$refs.arriveForm.form = res.data;
                        this.$refs.arriveForm.form.container[0] =
                            res.data.container[0];
                        this.$refs.arriveForm.form.container[1] = {
                            index: 1,
                            containerType: "GP",
                            containerSize: 20,
                            containerNo: "",
                            tradeType: "I",
                            ownerId: "",
                            ifHeavy: "",
                            cargoName: "",
                            cargoWeight: "",
                            entrustNo: "",
                            entrustOrgId: "",
                            entrustOrgName: "",
                            entrustOrgCode: ""
                        };
                    }
                    this.$refs.arriveForm.dialogForm = true;
                });
            },
            //改货重
            Tocargo(row) {
                this.$refs.Tocar.dialogForm = true;
                this.$refs.Tocar.sendLists = row.container;
                this.$refs.Tocar.carnum = row;
            },
            handleSend() {
                //批量发送
                if (this.multipleSelection2.length < 1) {
                    this.$message({
                        message: `请先选择一条数据`,
                        type: "error"
                    });
                    return;
                }
                this.sendUpDialog = true;
            },
            // click close
            handleDialogFormClose() {
                this.$refs.arriveForm.dialogForm = false;
            },
            handleExportSend() {
                let map = new Map();
                map.set("wagonNo", "车皮号");
                map.set("containerNo", "箱号");
                map.set("containerSize", "尺寸");
                map.set("ifHeavy", "空重");
                map.set("cargoName", "货名");
                map.set("cargoWeight", "货重");
                map.set("stratStationName", "发站");
                map.set("endStationName", "到站");
                map.set("arrivalTime", "车皮进港时间");
                let exportRecords = [];
                let arr = JSON.parse(JSON.stringify(this.multipleSelection2));
                let newArr = [];
                for (let i = 0; i < arr.length; i++) {
                    const el = arr[i];
                    if (el.container === null) {
                        let data = {
                            wagonNo: el.wagonNo,
                            containerNo: "",
                            containerSize: "",
                            ifHeavy: "",
                            cargoName: "",
                            cargoWeight: "",
                            stratStationName: "",
                            endStationName: "",
                            arrivalTime: el.arrivalTime
                        };
                        newArr.push(data);
                    } else if (el.container.length === 2) {
                        let data = [
                            {
                                wagonNo: el.wagonNo,
                                containerNo: el.container[0].containerNo,
                                containerSize: el.container[0].containerSize,
                                ifHeavy: el.container[0].ifHeavy,
                                cargoName: el.container[0].cargoName,
                                cargoWeight: el.container[0].cargoWeight,
                                stratStationName: el.container[0].stratStationName,
                                endStationName: el.container[0].endStationName,
                                arrivalTime: el.arrivalTime
                            },
                            {
                                wagonNo: el.wagonNo,
                                containerNo: el.container[1].containerNo,
                                containerSize: el.container[1].containerSize,
                                ifHeavy: el.container[1].ifHeavy,
                                cargoName: el.container[1].cargoName,
                                cargoWeight: el.container[1].cargoWeight,
                                stratStationName: el.container[1].stratStationName,
                                endStationName: el.container[1].endStationName,
                                arrivalTime: el.arrivalTime
                            }
                        ];
                        newArr.push(...data);
                    } else if (el.container.length === 1) {
                        let data = {
                            wagonNo: el.wagonNo,
                            containerNo: el.container[0].containerNo,
                            containerSize: el.container[0].containerSize,
                            ifHeavy: el.container[0].ifHeavy,
                            cargoName: el.container[0].cargoName,
                            cargoWeight: el.container[0].cargoWeight,
                            stratStationName: el.container[0].stratStationName,
                            endStationName: el.container[0].endStationName,
                            arrivalTime: el.arrivalTime
                        };
                        newArr.push(data);
                    }
                }
                console.log(newArr);
                let exportArr = JSON.parse(JSON.stringify(newArr));
                exportArr.forEach(record => {
                    let exportRecord = {};
                    for (let [key, value] of map.entries()) {
                        if (key === "ifHeavy") {
                            record[key] = ifHeavyType.get(record[key]);
                        }
                        exportRecord[value] = record[key];
                    }
                    exportRecords.push(exportRecord);
                });
                let date = getLocalTime(new Date(), "YYYY-MM-DD hh:mm:ss");
                newExportExcel("发送列表" + date, exportRecords);
            },
            handleExport() {
                let params = this.$assist.copySearchConditions(this.condition2)
                params.iDisplayLength = 999999
                this.loading = true
                sendList(params).then(res => {
                    if (res.data.aaData.length > 0) {
                        let map = new Map();
                        map.set("wagonNo", "车皮号");
                        map.set("containerNo", "箱号");
                        map.set("containerSize", "尺寸");
                        map.set("ifHeavy", "空重");
                        map.set("cargoName", "货名");
                        map.set("cargoWeight", "货重");
                        map.set("stratStationName", "发站");
                        map.set("endStationName", "到站");
                        map.set("commander", "指挥手");
                        map.set("driverName", "作业司机");
                        map.set("machineName", "作业机械");
                        map.set("jobTime", "装车时间");
                        map.set("arrivalTime", "车皮进港时间");
                        let exportRecords = [];
                        let arr = res.data.aaData
                        let newArr = [];
                        for (let i = 0; i < arr.length; i++) {
                            const el = arr[i];
                            if (el.container === null) {
                                let data = {
                                    wagonNo: el.wagonNo,
                                    containerNo: "",
                                    containerSize: "",
                                    ifHeavy: "",
                                    cargoName: "",
                                    cargoWeight: "",
                                    stratStationName: "",
                                    endStationName: "",
                                    commander:"",
                                    driverName:"",
                                    machineName:"",
                                    jobTime:"",
                                    arrivalTime: el.arrivalTime
                                };
                                newArr.push(data);
                            } else if (el.container.length === 2) {
                                let data = [
                                    {
                                        wagonNo: el.wagonNo,
                                        containerNo: el.container[0].containerNo,
                                        containerSize: el.container[0].containerSize,
                                        ifHeavy: el.container[0].ifHeavy,
                                        cargoName: el.container[0].cargoName,
                                        cargoWeight: el.container[0].cargoWeight,
                                        stratStationName: el.container[0].stratStationName,
                                        endStationName: el.container[0].endStationName,
                                        commander: el.container[0].commander,
                                        driverName: el.container[0].driverName,
                                        machineName: el.container[0].machineName,
                                        jobTime: el.container[0].jobTime,
                                        arrivalTime: el.arrivalTime
                                    },
                                    {
                                        wagonNo: el.wagonNo,
                                        containerNo: el.container[1].containerNo,
                                        containerSize: el.container[1].containerSize,
                                        ifHeavy: el.container[1].ifHeavy,
                                        cargoName: el.container[1].cargoName,
                                        cargoWeight: el.container[1].cargoWeight,
                                        stratStationName: el.container[1].stratStationName,
                                        endStationName: el.container[1].endStationName,
                                        commander: el.container[1].commander,
                                        driverName: el.container[1].driverName,
                                        machineName: el.container[1].machineName,
                                        jobTime: el.container[1].jobTime,
                                        arrivalTime: el.arrivalTime
                                    }
                                ];
                                newArr.push(...data);
                            } else if (el.container.length === 1) {
                                let data = {
                                    wagonNo: el.wagonNo,
                                    containerNo: el.container[0].containerNo,
                                    containerSize: el.container[0].containerSize,
                                    ifHeavy: el.container[0].ifHeavy,
                                    cargoName: el.container[0].cargoName,
                                    cargoWeight: el.container[0].cargoWeight,
                                    stratStationName: el.container[0].stratStationName,
                                    endStationName: el.container[0].endStationName,
                                    commander: el.container[0].commander,
                                    driverName: el.container[0].driverName,
                                    machineName: el.container[0].machineName,
                                    jobTime: el.container[0].jobTime,
                                    arrivalTime: el.arrivalTime
                                };
                                newArr.push(data);
                            }
                        }
                        console.log(newArr);
                        let exportArr = JSON.parse(JSON.stringify(newArr));
                        exportArr.forEach(record => {
                            let exportRecord = {};
                            for (let [key, value] of map.entries()) {
                                if (key === "ifHeavy") {
                                    record[key] = ifHeavyType.get(record[key]);
                                }
                                exportRecord[value] = record[key];
                            }
                            exportRecords.push(exportRecord);
                        });
                        let date = getLocalTime(new Date(), "YYYY-MM-DD hh:mm:ss");
                        newExportExcel("发送数据" + date, exportRecords);
                        this.loading = false
                    }
                }).catch(err => {
                    this.loading = false
                })
            },
            handleImport(val) {
                let uploadData = {
                    trainNo:"",
                    items:[]
                };
                if (val != null){
                    val.forEach((column, index) => {
                        if (index == 0){
                            uploadData.trainNo = column.时间.substr(9)
                        } else {
                            let dataArray = {}
                            this.$set(dataArray, 'wagonSortNo', index)
                            this.$set(dataArray, 'inDate', column.时间)
                            this.$set(dataArray, 'carType', column.车型)
                            this.$set(dataArray, 'wagonNo', column.车号)
                            this.$set(dataArray, 'startStationName', column.发站)
                            this.$set(dataArray, 'endStationName', column.到站)
                            this.$set(dataArray, 'shipper', column.发货人)
                            this.$set(dataArray, 'consignee', column.收货人)
                            this.$set(dataArray, 'containerNo1', column.箱号1)
                            this.$set(dataArray, 'containerNo2', column.箱号2)
                            this.$set(dataArray, 'containerType1', column.箱型1)
                            this.$set(dataArray, 'containerType2', column.箱型2)
                            this.$set(dataArray, 'containerSize1', column.尺寸1)
                            this.$set(dataArray, 'containerSize2', column.尺寸2)
                            this.$set(dataArray, 'cargoName1', column.品名1)
                            this.$set(dataArray, 'cargoName2', column.品名2)
                            this.$set(dataArray, 'ifHeavy1', column.空重1)
                            this.$set(dataArray, 'ifHeavy2', column.空重2)
                            this.$set(dataArray, 'cargoWeight1', column.货重1)
                            this.$set(dataArray, 'cargoWeight2', column.货重2)
                            uploadData.items.push(dataArray)
                        }
                    })
                    imptForDelayData(uploadData).then(res => {
                        if (res.data != "") {
                            this.$message({
                                message: res.data,
                                type: 'warning'
                            })
                        }
                        this.loadData1()
                    })
                }
            },
            handleExportPort() {
                let params = this.$assist.copySearchConditions(this.condition)
                params.iDisplayLength = 999999
                this.loading = true
                arriveList(params).then(res => {
                    if (res.data.aaData.length > 0) {
                        let map = new Map();
                        map.set('wagonNo', '车皮号')
                        map.set('container', '箱号')
                        map.set('container', '尺寸')
                        map.set('container', '箱型')
                        map.set('container', '空重')
                        map.set('container', '内外贸')
                        map.set('container', '箱主')
                        map.set('container', '货名')
                        map.set('container', '货重')
                        map.set('stratStationName', '发站')
                        map.set('endStationName', '到站')
                        map.set('shipper', '托运人')
                        map.set('shipperTel', '联系电话')
                        map.set('consignee', '收货人')
                        map.set('consigneeTel', '联系电话')
                        let exportRecords = [];
                        let arr = res.data.aaData
                        let newArr = [];
                        for (let i = 0; i < arr.length; i++) {
                            const el = arr[i];
                            if (el.container === null) {
                                let data = {
                                    wagonNo: el.wagonNo,
                                    containerNo: "",
                                    containerSize: "",
                                    ifHeavy: "",
                                    cargoName: "",
                                    stratStationName: "",
                                    endStationName: "",
                                    arrivalTime: el.arrivalTime
                                };
                                newArr.push(data);
                            } else if (el.container.length === 2) {
                                let data = [
                                    {
                                        wagonNo: el.wagonNo,
                                        containerNo: el.container[0].containerNo,
                                        containerSize: el.container[0].containerSize,
                                        ifHeavy: el.container[0].ifHeavy,
                                        cargoName: el.container[0].cargoName,
                                        stratStationName: el.container[0].stratStationName,
                                        endStationName: el.container[0].endStationName,
                                        arrivalTime: el.arrivalTime
                                    },
                                    {
                                        wagonNo: el.wagonNo,
                                        containerNo: el.container[1].containerNo,
                                        containerSize: el.container[1].containerSize,
                                        ifHeavy: el.container[1].ifHeavy,
                                        cargoName: el.container[1].cargoName,
                                        stratStationName: el.container[1].stratStationName,
                                        endStationName: el.container[1].endStationName,
                                        arrivalTime: el.arrivalTime
                                    }
                                ];
                                newArr.push(...data);
                            } else if (el.container.length === 1) {
                                let data = {
                                    wagonNo: el.wagonNo,
                                    containerNo: el.container[0].containerNo,
                                    containerSize: el.container[0].containerSize,
                                    ifHeavy: el.container[0].ifHeavy,
                                    cargoName: el.container[0].cargoName,
                                    stratStationName: el.container[0].stratStationName,
                                    endStationName: el.container[0].endStationName,
                                    arrivalTime: el.arrivalTime
                                };
                                newArr.push(data);
                            }
                        }
                        console.log(newArr);
                        let exportArr = JSON.parse(JSON.stringify(newArr));
                        exportArr.forEach(record => {
                            let exportRecord = {};
                            for (let [key, value] of map.entries()) {
                                if (key === "ifHeavy") {
                                    record[key] = ifHeavyType.get(record[key]);
                                }
                                if (key === "tradeType") {
                                    record[key] = tradeType.get(record[key]);
                                }
                                exportRecord[value] = record[key];
                            }
                            exportRecords.push(exportRecord);
                        });
                        let date = getLocalTime(new Date(), "YYYY-MM-DD hh:mm:ss");
                        newExportExcel("到达数据" + date, exportRecords);
                        this.loading = false
                    }
                }).catch(err => {
                    this.loading = false
                })
            },
            clickPick(row, event, column) {
                for (let i = 0; i < this.pickTable.length; i++) {
                    const el = this.pickTable[i]
                    if (el.isSelect) {
                        this.pickTable.splice(i, 1, { ...this.pickTable[i], isSelect: false })
                    }
                    if (el.wagonNo === row.wagonNo) {
                        this.pickTable.splice(i, 1, { ...this.pickTable[i], isSelect: true })
                        this.selectPickTable = this.pickTable[i]
                    }
                }
                console.log(this.pickTable)
                console.log(row, event, column)
            },
            dbclickPick(row, event) {
                console.log(row)
                let index = 0
                for (let i = 0; i < this.pickTable.length; i++) {
                    const el = this.pickTable[i]
                    if (el.wagonNo === row.wagonNo) {
                        index = i
                    }
                }
                this.pickTable.splice(index, 1)
                if (this.pickTable.length > 0) {
                    this.pickTable.splice(0, 1, { ...this.pickTable[0], isSelect: true })
                    this.selectPickTable = this.pickTable[0]
                } else {
                    this.selectPickTable = []
                }
                let isClick = false
                if (this.pickTableEd.length === 0) {
                    isClick = true
                }
                this.pickTableEd.push({ ...row, isClick })
                if (this.pickTableEd.length === 1) {
                    this.selectPickTableEd = this.pickTableEd[0]
                }

            },
            rightPick(row) {
                if (row.isSelect) {
                    this.dbclickPick(row)
                } else {
                    this.$message({ message: '请先选择一条数据', type: 'error' })
                }
            },
            leftPick(row) {
                if (row.isClick) {
                    this.dbclickPickEd(row)
                } else {
                    this.$message({ message: '请先选择一条数据', type: 'error' })
                }
            },
            clickPickEd(row, event, column) {
                for (let i = 0; i < this.pickTableEd.length; i++) {
                    const el = this.pickTableEd[i]
                    if (el.isClick) {
                        this.pickTableEd.splice(i, 1, { ...this.pickTableEd[i], isClick: false })
                    }
                    if (el.wagonNo === row.wagonNo) {
                        this.pickTableEd.splice(i, 1, { ...this.pickTableEd[i], isClick: true })
                        this.selectPickTableEd = this.pickTableEd[i]
                    }
                }
            },
            dbclickPickEd(row, event) {
                console.log(row)
                let index = 0
                for (let i = 0; i < this.pickTableEd.length; i++) {
                    const el = this.pickTableEd[i]
                    if (el.wagonNo === row.wagonNo) {
                        index = i
                    }
                }
                this.pickTableEd.splice(index, 1)
                let isSelect = false
                if (this.pickTable.length === 0) {
                    isSelect = true
                }
                this.pickTable.push({ ...row, isSelect })
                if (this.pickTable.length === 1) {
                    this.selectPickTable = this.pickTable[0]
                }
                if (this.pickTableEd.length > 0) {
                    this.pickTableEd.splice(0, 1, { ...this.pickTableEd[0], isClick: true })
                    this.selectPickTableEd = this.pickTableEd[0]
                } else {
                    this.selectPickTableEd = []
                }
            },
            pickUpEd() {
                let index = 0
                this.pickTableEd.forEach((f, i) => {
                    if (f.isClick) {
                        index = i
                    }
                })
                if (index !== 0) {
                    swapArray(this.pickTableEd, index - 1, index);
                } else {
                    this.$message({ message: '无法上移', type: 'error' })
                }
            },
            pickDownEd() {
                let index = 0
                this.pickTableEd.forEach((f, i) => {
                    if (f.isClick) {
                        index = i
                    }
                })
                console.log(index, this.pickTableEd.length)
                if (index + 1 !== this.pickTableEd.length) {
                    swapArray(this.pickTableEd, index, index + 1);
                } else {
                    this.$message({ message: '无法下移', type: 'error' })
                }
            },
            upOrDown(bool) {
                let index = 0
                for (let i = 0; i < this.pickTable.length; i++) {
                    const el = this.pickTable[i]
                    if (el.isSelect) {
                        index = i
                        this.pickTable.splice(i, 1, { ...el, isSelect: false })
                    }
                }
                if (bool) {
                    if (index === 0) {
                        index === this.pickTable.length - 1
                    } else {
                        index = index - 1
                    }
                } else {
                    if (index === this.pickTable.length - 1) {
                        index = 0
                    } else {
                        index = index + 1
                    }
                }
                this.pickTable.splice(index, 1, { ...this.pickTable[index], isSelect: true })
                this.selectPickTable = this.pickTable[index]
            }
        }
        ,
        watch: {
            pickUpDialog(bool) {
                if (!bool) {
                    this.pickTable = []
                    this.pickTableEd = []
                    this.selectPickTable = {}
                    this.selectPickTableEd = {}
                    this.isClick = true
                }
            }
        }
    }
    ;
</script>

<style>
    /*
            calendar css
            */

    .cj-bor {
        border: 1px solid #dcdfe6;
    }

    .cj-bgTitle {
        background-color: #ecf0fd;
    }

    .cj-bgBlue {
        background-color: #4e76ea;
    }

    .cj-bgRed {
        background-color: #ff310f;
    }

    .cj-bgGreen {
        background-color: #45c986;
    }

    .wb100 {
        width: 100%;
    }

    .clear1 {
        clear: both;
        height: 15px;
    }

    .cal-title {
        height: 40px;
        line-height: 40px;
        background: #ecf0fd;
        border: 1px solid #429e6c;
        color: #333;
        padding: 0 10px;
        clear: both;
    }

    .cal-content {
        text-align: center;
        width: 313px;
        padding: 10px;
        border-right: 1px solid #429e6c;
        border-left: 1px solid #429e6c;
        border-bottom: 1px solid #429e6c;
    }

    .cal-month {
        width: 580px;
        font-size: 12px;
        margin: 8px 0 0 15px;
    }

    .month-item {
        width: 45px;
        float: left;
        margin: 3px;
    }

    .month-s {
        margin-top: 5px;
        margin-bottom: 15px;
    }

    .month-m {
        width: 45px;
        height: 20px;
        background-color: #cccccc;
    }

    .cal-title select {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        position: absolute;
        z-index: 9;
        -webkit-appearance: none;
        padding: 5px 20px;
    }

    body,
    td,
    .p1,
    .p2,
    .i {
        font-family: arial;
    }

    body {
        margin: 6px 0 0 0;
        background-color: #f3f3f3;
        color: #000;
    }

    table {
        border: 0;
    }

    .cal {
        width: 608px;
        font-size: 12px;
        margin: 8px 0 0 15px;
    }

    .cal .top {
        height: 40px;
        line-height: 40px;
        border: 1px solid #eff2f6;
        color: #333;
        padding: 0 10px;
        clear: both;
        position: relative;
    }

    .cal .top select {
        font-size: 14px;
    }

    .cal .top input {
        padding: 0;
    }

    .cal ul.wk {
        margin: 0;
        padding: 0 9px;
        height: 50px;
        color: #888;
        font-size: 16px;
        border-left: 1px solid #eff2f6;
        border-right: 1px solid #eff2f6;
    }

    .cal ul.wk li {
        float: left;
        width: 80px;
        text-align: center;
        line-height: 50px;
        list-style: none;
    }

    .cal ul.wk li b {
        font-weight: normal;
        color: #429e6c;
    }

    .cal .cm {
        clear: left;
        position: relative;
        border-left: 1px solid #eff2f6;
        border-right: 1px solid #eff2f6;
        border-bottom: 1px solid #eff2f6;
    }

    .cell2 {
        width: 94px;
        height: 80px;
        float: left;
        text-align: center;
        padding: 10px 0;
        margin: 0;
        cursor: pointer;
        border: 1px solid #eff2f6;
    }

    .cell2 .so {
        text-align: center;
        height: 20px;
        line-height: 20px;
        font: 20px arial;
    }

    .cell2 .do {
        text-align: center;
        height: 40px;
        line-height: 20px;
        font: 12px arial;
    }

    .cell2 .do b {
        width: 20px;
        height: 20px;
        line-height: 20px;
        background-color: #ff4045;
        text-align: center;
        color: #ffffff;
        -moz-border-radius: 50%;
        -webkit-border-radius: 50%;
        border-radius: 50%;
        position: absolute;
        top: 5px;
        right: 5px;
        font-weight: normal;
    }

    .cal .cm .cell {
        position: absolute;
        width: 80px;
        height: 60px;
        text-align: center;
        padding: 10px 0;
        margin: 0 0 0 9px;
        cursor: pointer;
        border: 1px solid #eff2f6;
    }

    .cal .cm .cell .so {
        text-align: center;
        height: 20px;
        line-height: 20px;
        font: 20px arial;
    }

    .cal .cm .cell .do {
        text-align: center;
        height: 40px;
        line-height: 20px;
        font: 12px arial;
    }

    .cal .cm .cell .do b {
        width: 20px;
        height: 20px;
        line-height: 20px;
        background-color: #ff4045;
        text-align: center;
        color: #ffffff;
        -moz-border-radius: 50%;
        -webkit-border-radius: 50%;
        border-radius: 50%;
        position: absolute;
        top: 5px;
        right: 5px;
        font-weight: normal;
    }

    .cal .bm {
        text-align: right;
        height: 30px;
        line-height: 30px;
        padding: 0 13px 0 0;
        border: 1px solid #eff2f6;
        border-top: 1px dashed #eee;
        clear: both;
        padding: 0 10px;
        font-size: 14px;
    }

    .cal .bm .heavenly-branch {
        color: #429e6c;
        float: left;
    }

    .cal .fd {
        display: none;
        position: absolute;
        border: 1px solid #dddddf;
        background: #fff;
        color: #333;
        padding: 10px;
        line-height: 21px;
        width: 150px;
        border-radius: 10px;
    }

    .cal .fd:before {
        content: "";
        position: absolute;
        left: -8px;
        width: 0;
        height: 0;
        border-top: 8px solid transparent;
        border-right: 8px solid #dddddf;
        border-bottom: 8px solid transparent;
    }

    .cal .fd:after {
        content: "";
        position: absolute;
        left: -6px;
        top: 10px;
        width: 0;
        height: 0;
        border-top: 8px solid transparent;
        border-right: 8px solid #fff;
        border-bottom: 8px solid transparent;
    }

    .cal .fd b {
        font-weight: normal;
        color: #429e6c;
    }

    .cal .step {
        float: right;
        font-size: 16px;
    }

    .cal .step span {
        cursor: pointer;
    }

    .cal .step .prev {
        margin-right: 10px;
    }

    .cal .select {
        width: 200px;
        height: 40px;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        position: absolute;
    }

    .cal .select select {
        -webkit-appearance: none;
        padding: 5px 20px;
    }

    .cal .now-date {
        float: right;
        padding: 0px 10px;
        background-color: #429e6c;
        color: #fff;
        font-size: 12px;
        height: 20px;
        line-height: 20px;
        margin-top: 6px;
        text-decoration: none;
    }

    .table-line-diy {
        width: 100%;
        height: 1px;
        background: #ebeef5;
        position: absolute;
        left: 0;
        top: 50%;
    }
</style>
